home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / architecture / adb_kb_map.h < prev    next >
Text File  |  1992-07-13  |  2KB  |  77 lines

  1. /* Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved.
  2.  * 
  3.  *    File:    achitecture/adb_kb_map.h
  4.  *
  5.  *    Definition of ADB keyboard scancode conversion mechanism.
  6.  *
  7.  * HISTORY
  8.  * 07-Oct-91  Doug Mitchell at NeXT
  9.  *    Created
  10.  */
  11.  
  12. #ifndef    _ARCHITECTURE_ADB_KB_MAP_
  13. #define _ARCHITECTURE_ADB_KB_MAP_
  14.  
  15. #import <architecture/ascii_codes.h>
  16. #import <architecture/adb_bus.h>
  17.  
  18. /*
  19.  * Each key down event maps to an unsigned short. The first 128 possible
  20.  * mapped values are the ASCII character set. Values starting at 0x100 are 
  21.  * non-printing keys, called "super keys", which are interpreted by
  22.  * the keyboard driver directly. 
  23.  */
  24. typedef unsigned short     adb_key_val_t;
  25.  
  26. #define ADB_SUPER_BASE        0x100
  27. #define KEY_INVALID        ADB_SUPER_BASE        /* invalid */
  28. #define ADB_RESET        (ADB_SUPER_BASE + 1)    /* apple reset */
  29. #define ADB_POWER        ADB_RESET        /* NeXT power */
  30. #define BRIGHT_UP        (ADB_SUPER_BASE + 2)
  31. #define BRIGHT_DOWN        (ADB_SUPER_BASE + 3)
  32. #define VOLUME_UP        (ADB_SUPER_BASE + 4)
  33. #define VOLUME_DOWN        (ADB_SUPER_BASE + 5)
  34. #define CURS_LEFT        (ADB_SUPER_BASE + 6)    /* cursor keys */
  35. #define CURS_RIGHT        (ADB_SUPER_BASE + 7)
  36. #define CURS_UP            (ADB_SUPER_BASE + 8)
  37. #define CURS_DOWN        (ADB_SUPER_BASE + 9)
  38. #define CTL_LEFT        (ADB_SUPER_BASE + 10)    /* control keys */
  39. #define CTL_RIGHT        (ADB_SUPER_BASE + 11)
  40. #define SHIFT_LEFT        (ADB_SUPER_BASE + 12)    /* shift keys */
  41. #define SHIFT_RIGHT        (ADB_SUPER_BASE + 13)
  42. #define OPTION_LEFT        (ADB_SUPER_BASE + 14)     /* Apple: option */
  43. #define OPTION_RIGHT        (ADB_SUPER_BASE + 15)
  44. #define ALT_LEFT        OPTION_LEFT        /* NeXT: Alt */
  45. #define ALT_RIGHT        OPTION_RIGHT
  46. #define APPLE_LEFT        (ADB_SUPER_BASE + 16)    /* Apple: Apple */
  47. #define APPLE_RIGHT        (ADB_SUPER_BASE + 17)    
  48. #define CMD_LEFT        APPLE_LEFT        /* NeXT: command */
  49. #define CMD_RIGHT        APPLE_RIGHT
  50. #define CAPS_LOCK        (ADB_SUPER_BASE + 18)
  51. #define ADB_CLEAR        (ADB_SUPER_BASE + 19)
  52. #define KB_INTERRUPT        (ADB_SUPER_BASE + 20)
  53.  
  54. /*
  55.  * ASCII values for one keycode. Mapping for one keyboard consists of 
  56.  * an array of 128 of these, one for each possible scan code.
  57.  */
  58. typedef struct {
  59.     adb_key_val_t normal;        // non meta ASCII values
  60.     adb_key_val_t shift;
  61.     adb_key_val_t control;
  62.     adb_key_val_t control_shift;    
  63. } adb_key_t;
  64.  
  65. /*
  66.  * Mapping for a keyboard described by an adbHandlerId.
  67.  * adb_kb_map.key points to an array of NUM_ADB_KEYCODES keycodes.
  68.  */
  69. #define NUM_ADB_KEYCODES    128
  70.  
  71. typedef struct {
  72.     adbHandlerId        handler_id;
  73.     const adb_key_t        *key;
  74. } adb_kb_map_t;
  75.  
  76. #endif    _ARCHITECTURE_ADB_KB_MAP_
  77.